<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">
	
	<title>운세의신</title>

	<link rel="stylesheet" type="text/css" href="/css/common.css" />
	<link rel="stylesheet" type="text/css" href="/css/mypage.css"/>

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script src="/js/utility/common_util.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$(".result dl:first").addClass('first');
			$(".result dl:last").addClass('end');
			
			$("#search_keyword").focus();
			
			$("#frm").submit(function() {
				if ($("#search_keyword").val() == '') {
					alert("검색할 스타의 이름 입력하세요.");
					return false;
				}
			});
			
			$("#btnSearch").click(function() {
				$("#frm").submit();
			});
		});

		function send(idx, artistName) {
			var frm = opener.frm;
			frm.artist_idx.value = idx;
			frm.artist_name.value = artistName;
			window.close();
		}
	</script>

</head>
<body>
<div id="wrap">
	<div class="pop">
		<form name="frm" id="frm" method="post" action="/star/starpt/search">
			<fieldset>
				<h1><img src="http://www.unsin.co.kr/images/star/ptit_star.png" alt="스타궁합" /></h1>
				<p class="zigline"></p>
				<!--서브타이틀-->

				<div class="contents">
					<h2>스타 검색하기</h2>
				
					<div class="box2">
						<dl>
							<dt>이름</dt>
							<dd><input type="text" name="search_keyword" id="search_keyword" size="20" value="<?=$search_keyword?>" title="이름을 입력하세요" class="inpText" /></dd>
							<dd><a href="javascript:;" id="btnSearch"><img src="http://www.unsin.co.kr/images/common/bt_seach.png" alt="검색" align="absmiddle" /></a></dd>
						</dl>
					</div><!--box2-->
					
					
					<!--스타검색이 되었을시-->
<?	if (!empty($artist_list) && count($artist_list) > 0) : ?>
					<div class="result">
				   		<span class="text"><em><?=count($artist_list)?>명</em>의 스타가 검색되었습니다.</span>
<?		foreach ($artist_list as $item) : ?>
				   		<dl>
							<dt><img src="<?=$item['photo']?>" width="50" height="50" alt="스타이미지" /></dt>
							<dd class="id"><span><?=$item['artist_name']?></span></dd>
							<dd class="date"><?=$item['job']?><span><?=$item['birth_yyyy'] ?>년 <?=$item['birth_mm'] ?>월 <?=$item['birth_dd'] ?>일</span></dd>
							<dd class="bt_gift"><a href="javascript:;" onclick="send('<?=$item['idx']?>', '<?=$item['artist_name']?>', '<?=$item['sex']?>', '<?=$item['birth_yyyy'] ?>', '<?=$item['birth_mm'] ?>', '<?=$item['birth_dd'] ?>')"><img src="http://www.unsin.co.kr/images/common/bt_slect.png" alt="선택하기" /></a></dd>
						</dl>
<?		endforeach ?>
					</div><!--result-->
					<!--//스타검색이 되었을시-->

<?	elseif (!empty($search_keyword)) : ?>

					<!--스타검색이 안되었을시-->
					<div class="result_no">
				   		<span class="text_no">조건에 만족하는 스타가 운세의신 DB에 없습니다.<br/>다시 검색해주세요.</span>
					</div><!--result-->
					<!--//스타검색이 안되었을시-->
<?	endif ?>
				</div>
			</fieldset>
		</form>
		<!--하단--> 
	</div>
	<!--pop--> 
</div>
<!--전체-->
</body>
</html>